package com.apps.diet.service;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.stereotype.Service;

import com.apps.diet.dao.INutriFactsDao;
import com.apps.diet.domain.NutriFacts;

@Service("nutriFactsService")
//@Transactional
public class NutriFactsService implements INutriFactsService {

	protected static Logger logger = Logger.getLogger(NutriFactsService.class);
	
	INutriFactsDao nutriFactsDao;
	
	@Autowired
	@Required
	public void setDietDao(INutriFactsDao dietDao) {
		this.nutriFactsDao = dietDao;
	}

	@Override
	public List<NutriFacts> getNutriFacts(String searchString) {
		List<NutriFacts> nutriFactsResults = nutriFactsDao.getNutriFacts(searchString);
		return nutriFactsResults;
	}

	@Override
	public boolean updateNutriFacts(NutriFacts nutriFacts) {
		return nutriFactsDao.updateNutriFacts(nutriFacts);
	}

	@Override
	public boolean createNutriFacts(NutriFacts nutriFacts) {
		return nutriFactsDao.createNutriFacts(nutriFacts);
	}

	@Override
	public boolean deleteNutriFacts(int nutriFactsId) throws Exception {
		return nutriFactsDao.deleteNutriFacts(nutriFactsId);
	}
}
